/*
* $Id: AddChangeView.h 161 2010-10-03 23:45:28Z volok-aleksej@yandex.ru $
*
* Copyright 2009 by Volokitin Alexey
* All rights reserved
*
*/
#ifndef _ADD_CHANGE_VIEW_H_
#define _ADD_CHANGE_VIEW_H_

#include "../ViewJournal.h"
#include "Visual/Drawers/EditorDrawer/EditorDrawer.h"

class CAddChangeView : public CEmptyViewJournal, public ISubscriber
{
	int m_nTick;
private:
	bool m_bSaveEnable;
	CButton m_buttonSave;
	CButton m_buttonCancel;
protected:
	CScrollBar m_VScroll;
	bool m_bVScroll;
protected:
	int m_nIdParameter;
	CEditorDrawer m_editorDrawer;
	std::map<int, std::tstring> m_aCurValues;
protected:
	virtual void GetCurValue();
	virtual void InitCurrentValue();
protected:
	virtual void PaintView(CDC* dc, CRect rect);
	void UpgradeScroll();
	void EnableSaveButton(bool bEnable);
public:
	virtual void EventHandler();
protected:
	DECLARE_MESSAGE_MAP();
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnPaint();
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnCancel();
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint point);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
public:
	CAddChangeView(CState* pState);
	virtual ~CAddChangeView();
};

#endif/*_ADD_CHANGE_VIEW_H_*/
